import $ from './lib/jquery.esm.js';

$.ajax({
  type: "get",
  url: "../interface/getitems.php",
  dataType: "json"
}).then(res => {

  let template = '';
console.log(res);
  res.forEach(el => {
   console.log(1);
    let pic = JSON.parse(el.picture);
    console.log(pic);
    template += `  <div>
    <div class="box8-img">
      <img src="../img/详情/10006.avif" alt="">
    </div>
    <div class="box8-text">
      <p>Apple iPhone 13 Pro (A2639) 256GB 远峰蓝色 支持移动联通电信</p>
      <p><span>￥8999.00</span></p>
      <p>55227人已购买</p>
    </div>
  </div>`;
  });
 
console.log(template)

  $('.box8-bottom').html(template);

}).catch(xhr => {
  console.log(xhr.status);
});